<!DOCTYPE html>
<html lang="zh-CN" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>教师首页 - 学生管理系统</title>
    <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/css/bootstrap.min.css" rel="stylesheet">
    <link href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.7.2/font/bootstrap-icons.css" rel="stylesheet">
    <style>
        .sidebar {
            min-height: 100vh;
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
        }
        .sidebar .nav-link {
            color: rgba(255, 255, 255, 0.8);
            padding: 12px 20px;
            border-radius: 8px;
            margin: 5px 10px;
            transition: all 0.3s;
        }
        .sidebar .nav-link:hover,
        .sidebar .nav-link.active {
            color: white;
            background: rgba(255, 255, 255, 0.2);
            transform: translateX(5px);
        }
        .main-content {
            background: #f8f9fa;
            min-height: 100vh;
        }
        .welcome-card {
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
            color: white;
            border-radius: 15px;
            padding: 2rem;
            margin-bottom: 2rem;
        }
        .action-card {
            background: white;
            border-radius: 15px;
            padding: 1.5rem;
            box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
            transition: transform 0.3s;
            height: 100%;
        }
        .action-card:hover {
            transform: translateY(-5px);
        }
        .action-icon {
            width: 50px;
            height: 50px;
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 20px;
            color: white;
            margin-bottom: 1rem;
        }
        .action-icon.courses { background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%); }
        .action-icon.students { background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%); }
        .action-icon.schedule { background: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%); }
        .action-icon.profile { background: linear-gradient(135deg, #fa709a 0%, #fee140 100%); }
    </style>
</head>
<body>
    <div class="container-fluid">
        <div class="row">
            <!-- 侧边栏 -->
            <div class="col-md-3 col-lg-2 px-0">
                <div class="sidebar">
                    <div class="p-3">
                        <h4 class="text-white mb-4">
                            <i class="bi bi-person-badge me-2"></i>教师中心
                        </h4>
                        <nav class="nav flex-column">
                            <a class="nav-link active" href="/teacher/dashboard">
                                <i class="bi bi-house-door me-2"></i>首页
                            </a>
                            <a class="nav-link" href="/teacher/courses">
                                <i class="bi bi-book me-2"></i>我的课程
                            </a>
                            <a class="nav-link" href="/teacher/schedule">
                                <i class="bi bi-calendar3 me-2"></i>授课安排
                            </a>
                            <a class="nav-link" href="/teacher/profile">
                                <i class="bi bi-person me-2"></i>个人信息
                            </a>
                            <hr class="text-white-50">
                            <a class="nav-link" href="/logout">
                                <i class="bi bi-box-arrow-right me-2"></i>退出登录
                            </a>
                        </nav>
                    </div>
                </div>
            </div>
            
            <!-- 主内容区 -->
            <div class="col-md-9 col-lg-10">
                <div class="main-content">
                    <div class="p-4">
                        <!-- 欢迎卡片 -->
                        <div class="welcome-card" th:if="${teacher}">
                            <div class="row align-items-center">
                                <div class="col-md-8">
                                    <h2 class="mb-2">欢迎回来，<span th:text="${teacher.name}">教师</span>！</h2>
                                    <p class="mb-0">工号：<span th:text="${teacher.teacherNumber}">T2024001</span></p>
                                    <p class="mb-0">院系：<span th:text="${teacher.department}">计算机学院</span></p>
                                </div>
                                <div class="col-md-4 text-end">
                                    <i class="bi bi-person-badge" style="font-size: 4rem; opacity: 0.3;"></i>
                                </div>
                            </div>
                        </div>
                        
                        <!-- 统计信息 -->
                        <div class="row g-4 mb-4">
                            <div class="col-md-6">
                                <div class="action-card">
                                    <div class="d-flex align-items-center">
                                        <div class="action-icon courses me-3">
                                            <i class="bi bi-book"></i>
                                        </div>
                                        <div>
                                            <h3 class="mb-0" th:text="${courseCount}">0</h3>
                                            <p class="text-muted mb-0">教授课程</p>
                                        </div>
                                    </div>
                                </div>
                            </div>
                            <div class="col-md-6">
                                <div class="action-card">
                                    <div class="d-flex align-items-center">
                                        <div class="action-icon students me-3">
                                            <i class="bi bi-people"></i>
                                        </div>
                                        <div>
                                            <h3 class="mb-0">∞</h3>
                                            <p class="text-muted mb-0">学生总数</p>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                        
                        <!-- 快速操作 -->
                        <div class="row g-4">
                            <div class="col-md-6 col-lg-3">
                                <div class="action-card text-center">
                                    <div class="action-icon courses mx-auto">
                                        <i class="bi bi-book"></i>
                                    </div>
                                    <h5 class="mb-2">我的课程</h5>
                                    <p class="text-muted mb-3">管理教授的课程</p>
                                    <a href="/teacher/courses" class="btn btn-primary w-100">查看课程</a>
                                </div>
                            </div>
                            <div class="col-md-6 col-lg-3">
                                <div class="action-card text-center">
                                    <div class="action-icon courses mx-auto">
                                        <i class="bi bi-plus-circle"></i>
                                    </div>
                                    <h5 class="mb-2">创建课程</h5>
                                    <p class="text-muted mb-3">添加新的课程</p>
                                    <a href="/teacher/courses/add" class="btn btn-outline-primary w-100">立即创建</a>
                                </div>
                            </div>
                            <div class="col-md-6 col-lg-3">
                                <div class="action-card text-center">
                                    <div class="action-icon schedule mx-auto">
                                        <i class="bi bi-calendar3"></i>
                                    </div>
                                    <h5 class="mb-2">授课安排</h5>
                                    <p class="text-muted mb-3">查看课程时间表</p>
                                    <a href="/teacher/schedule" class="btn btn-outline-success w-100">查看安排</a>
                                </div>
                            </div>
                            <div class="col-md-6 col-lg-3">
                                <div class="action-card text-center">
                                    <div class="action-icon profile mx-auto">
                                        <i class="bi bi-person"></i>
                                    </div>
                                    <h5 class="mb-2">个人信息</h5>
                                    <p class="text-muted mb-3">修改个人资料</p>
                                    <a href="/teacher/profile" class="btn btn-outline-info w-100">编辑资料</a>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
    
    <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/js/bootstrap.bundle.min.js"></script>
</body>
</html>
